#ifndef LIST_H
#define LIST_H

#include <QAbstractListModel>
#include <QObject>
#include <any>
#include "MyFunc.h"

class List : public QAbstractListModel//实现自定义的列表模型
{
    Q_OBJECT
public:
    explicit List(QObject *parent = nullptr);
    ~List();
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    //role 参数的默认值是Qt::DisplayRole
    void addFunc(MyFunc* function);//添加
    void rmFunc(int row);//更新list

    std::vector<MyFunc*> funcList;//存放每一条函数的信息
};

#endif // LIST_H
